//redis@4.0.1
var redis= require('redis');
var M=require("ming_node");
app= M.server()
app.listen(8888)
var {RedisDb,RedisBaseRpcApi}=require("../../ming_node_plgins/RedisBaseRpcApi")

//
async function getRedisClient(){
    const redisClient = redis.createClient();
    redisClient.on('error', (err) => console.error('Redis Client Error', err));
    await redisClient.connect();
    return redisClient;
}


async function main(){
     let redisClient=await getRedisClient();
     let tableName="ming";
      let redisDb= new RedisDb({tableName,redisClient:redisClient});
      let api=  new RedisBaseRpcApi({tableName, redisDb})
      app.use(api)
}

main()